package org.example.salesystem.service.impl;

import org.example.salesystem.entity.ResultBody;
import org.example.salesystem.mapper.GoodsMesMapper;
import org.example.salesystem.service.GoodsMesService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Map;

@Service
public class GoodsMesServiceimpl implements GoodsMesService {
    @Autowired
    private GoodsMesMapper goodsMesMapper;
    @Override
    public ResultBody GoodsMessage(String code)
    {
        if(goodsMesMapper.GoodsMessage(code)!=null)
        {
            return new ResultBody(200,"查看成功",goodsMesMapper.GoodsMessage(code),goodsMesMapper.GoodsMessage(code).size());
        }
        return new ResultBody(500,"查看失败",false);
    }
    @Override
    public ResultBody displayComment(String code)
    {
        if(goodsMesMapper.displayComment(code)!=null)
        {
            return new ResultBody(200,"查看成功",goodsMesMapper.displayComment(code),goodsMesMapper.displayComment(code).size());
        }
        return new ResultBody(500,"查看失败",false);

    }


}
